package com.xx.ch08.demo.demo04;

/**
 * @author 许欣
 * 时间：2022/4/20 11:19
 * 描述：
 */
public class UserServiceProxy implements UserService{
    private  UserServiceImpl userService;

    public void setUserService(UserServiceImpl userService) {
        this.userService = userService;
    }

    @Override
    public void add() {
        log("add");
        userService.add();
    }

    @Override
    public void delete() {
        log("delete");
        userService.delete();
    }

    @Override
    public void update() {
        log("update");
        userService.update();
    }

    @Override
    public void select() {
        log("select");
        userService.select();
    }
    //日志方法
    public void log(String msg){
        System.out.println("使用"+msg);
    }
}
